using System;
using System.Text;
using System.Collections.Generic;
using System.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.PolicyInjection.Configuration;

namespace EntLibContrib.PolicyInjection
{
    public abstract class CompositeMatchingRuleData : MatchingRuleData
    {
        private const string MatchingRulesPropertyName = "MatchingRules";

        protected CompositeMatchingRuleData()
        {
        }

        protected CompositeMatchingRuleData(string matchingRuleName, Type matchingRuleType)
            : base(matchingRuleName, matchingRuleType)
        {
        }

        [ConfigurationProperty(MatchingRulesPropertyName, IsDefaultCollection=true)]
        public NameTypeConfigurationElementCollection<MatchingRuleData, CustomMatchingRuleData> MatchingRules
        {
            get { return (NameTypeConfigurationElementCollection<MatchingRuleData, CustomMatchingRuleData>)base[MatchingRulesPropertyName]; }
            set { base[MatchingRulesPropertyName] = value; }
        }
    }
}
